<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Calc(a,b){
            this.add=function(){
            return a+b;
        }
            this.sub=function(){
            return a-b;
        }
            this.mul=function(){
            return a*b;
        }
            this.div=function(){
            if(b===0){
            return "b不能为0";
        }
        else{
            return a/b;
        }
        }
        }
            let calc=new Calc(32,43);
            let r1=calc.add();
            let r2=calc.sub();
            let r3=calc.mul();
            let r4=calc.div();
            console.log(r1,r2,r3,r4);
        </script>
</body>
</html>